<template>
  <div>
    <el-tabs v-model="activeName" type="border-card" @tab-click="tabClick">
      <!-- switch开关 -->
      <el-tab-pane label="项目信息" name="project">
        <project :switch="true" @toContract="toContract" ref="project"></project>
      </el-tab-pane>
      <el-tab-pane label="合同信息" name="contract" :disabled="disC">
        <contract :switch="true" @toIndex=toIndex @toIt=toIt ref="contract"></contract>
      </el-tab-pane>
      <el-tab-pane label="资产及服务信息" name="it" :disabled="disI">
        <it :switch="true" @toIndex=toIndex @toContract="toContract" ref="it"></it>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import Project from './project.vue';
import Contract from '../components/contract.vue';
import It from '../components/it.vue';
export default {
  name: 'UsualWait',
  components: {
    Project, Contract, It
  },
  props: {

  },
  data () {
    return {
      activeName: 'project',
      disC: true,
      disI: true,
    }
  },
  created () {

  },
  mounted () {
    this.init()
  },
  methods: {
    init () {
      this.$refs.project.init()
    },
    tabClick (tab) {
      if (tab.name === 'project') {
        this.$refs.project.init()
      } else if (tab.name === 'contract') {
        this.$refs.contract.init()
      } else if (tab.name === 'it') {
        this.$refs.it.init()
      }
    },
    toIndex () {
      this.activeName = 'project'
      this.$refs.project.init()
    },
    toContract () {
      this.disC = false
      this.activeName = 'contract'
      this.$refs.contract.init()
    },
    toIt () {
      this.disI = false
      this.activeName = 'it'
      this.$refs.it.init()
    }
  },
  computed: {

  }
}
</script>
<style lang="scss" scoped>
</style>
